<?php
/**
 * xysc users Version1.0
 * ==================================
 * Copy 2016-2017
 * Web:www.xjh7.com
 * ==================================
 * Author:xjh
 * Date:2016-2-23
*/

	
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<title><?php echo $info[0]['goods_name'];?></title>
<script type="text/javascript" src="<?php echo JS_URL;?>jquery.js"></script>
<script type="text/javascript" src="<?php echo JS_URL;?>details.js"></script>
<link rel="stylesheet" type="text/css" href="<?php echo CSS_URL;?>details.css" />
<script>
	$(function (){

		$("#cart").click(function (){

			$.ajax({
				url:'index.php?r=order/Cartadd&goods_id=<?php echo $goods_id?>',
				type:'post',
				data:{"type":"addpro"},
				success:function(data){
					if(data == 1){
						alert('加入购车成功');
					}else{
						alert('加入购车失败');
					}
				},
				error:function (){
					alert('请先登录！');
					window.location.href="./index.php?r=user/login";
				}
			});
		})
	})
</script>
</head>
<body>
	<div id="content">
		<div id="header">
			<div id="logo" ><a href="./index.php"><img src="<?php echo IMG_URL;?>header.jpg" title="首页"/></a></div>
			<div id="info">
				<table>
					<tr>
						<td>
							<p><a href="#">topfeel旗舰店</a></p>
							<p><span class="focus">品牌直销</span><span style="margin-top:100px;"><a href="#"><img src="<?php echo IMG_URL;?>ww.png" /></a></span></p>
						</td>
						<td>
							<p style="color:#666;font-weight:bold;">描 述  服 务  物 流 </p> 
							<p style="color:#b30000;font-weight:bold;">4.9↑     4.9↑   4.9↑</p> 
						</td>
						<td style="color:#666;">手机逛</td>
					</tr>
				</table>
			</div>
			<div id="search">
			<form action="./index.php?r=goods/category" method="post">
				<input type="text" class="text" name="search" />
				<input type="submit" value="搜索" name="all" class="submit" />
				<input type="submit" value="本站搜索" name="location" class="submit l" />
				<ul>
					<li><a href="#">电脑主机</a>|</li>
					<li><a href="#">台式电脑 </a>|</li>
					<li><a href="#"> 迷你主机 </a>|</li>
					<li><a href="#">主机</a></li>
				</ul>
				</form>
			</div>
		</div>
		<div id="ad">
			<img src="<?php echo IMG_URL;?>ad_sale.png" />
		</div>
		<div id="left" >
			<div id="pic">
				<img src="<?php echo $image['img0'];?>" id="img" />
				<div id="divTip"></div>
				<div id="url" >
					<ul >
					<?php for($i=0;$i<count($image)-2;$i++){?>
					<?php if(empty($image['img'.$i])){ continue;} else{?>
					<li><div class="k"  ><img src="<?php  echo $image['img'.$i];?>"/></div></li>
					<?php }}?>
					</ul>
				</div>
			</div>
			<div id="info">
				<p style="font-weight:bold"><?php echo $info[0]['goods_name'];?></p>
				<p style="color:#ee0a3b;font-size:14px;"><?php echo $info[0]['goods_info'];?></p>
				<div id="price">
					<p style="margin-top:-40px;margin-left:50px;font-size:12px;color:#fff"><?php echo $info[0]['goods_salpro'];?></p>
					<p style="margin-top:20px;font-size:12px;">专柜价：<span style="text-decoration:line-through;"><?php echo $info[0]['goods_zgprice'];?></span></p>
					<p style="padding-top:10px;font-size:12px;">促销价：<span style="color:#b30000;">¥</span><span style="font-family:微软雅黑;color:#b30000;font-weight:bold;font-size:2em;"> <?php echo $info[0]['goods_price']?></span></p>
					<p style="padding-top:20px;font-size:12px;">特权价：¥<?php echo $info[0]['goods_tqprice'];?></p>
				</div>
				<p style="padding:10px;font-size:12px;">运费  快递: 0.00</p>
				<div id="xl">
					<table>
						<tr>
							<td>月销量<span> 14700</span></td>
							<td>累计评价 <span>154900</span></td>
							<td>送天猫积分<span style="color:green"> 289</span></td>
						</tr>  
					</table>
				</div>
						
						<div id="pur">
						
						<?php for($i=0;$i<count($styleinfo);++$i){ 
						if($i==0)
						{?>			
							<p>
							
							<?php echo $styleinfo[$i]['parent_name'];?>
								<em><?php echo $styleinfo[$i]['attr_name'];?></em>	
							<?php }else 
							{
							if( $styleinfo[$i]['parent_name']== $styleinfo[$i-1]['parent_name'])
							{ ?>
									<em><?php echo $styleinfo[$i]['attr_name'];?></em>	
							<?php }
							else
							{ ?>
							</p>
							<p>
							<?php echo $styleinfo[$i]['parent_name'];?>
							<em><?php echo $styleinfo[$i]['attr_name']; ?></em>
							<?php	}
								}
							}?>
							</p>
						<p>数量　　　<input type="text" name="goods_count"  style="width:30px;" />件</p>
						<p style="margin-bottom:30px;">服务承诺 无忧退换货</p>
					<span><a href="#" class="text submit1" style="display: none">立即购买</a></span>
					<span><a href="javascritp:void(0);"   id="cart" class="text submit2" style="position:relative;top:-50px;margin:0px 0 50px 150px">加入购物车</a></span>
				</div>
			</div>
			<div id="sal">
				<div id="sale_info">
					<h3><?php echo $store_info['store_name']?></h3>
					<table>
						<p id="dian"><?php echo $store_info['store_type']?></p>
						<p id="dian2"><em><?php echo $store_info['store_years']?></em>　轩辕<?php echo $store_info['store_years']?>年店</p>
						<tr><td>描述</td><td>服务</td><td>物流</td></tr>
						<tr><td><span>4.8↑</span></td><td><span>4.8↑</span></td><td><span>4.8↑</span></td></tr>
					</table>
					<a href="#"  class="left">进店逛逛</a><a href="#" class="right">收藏店铺</a>
				</div>
				<div id="recom">
					<div class="rec">
						<h4>> 宝贝推荐<em><a href="#">更多</a></em></h4>
						<?php foreach($rec_info as $_v){?>
						<div class="baby">
							<a href="./index.php?r=goods/details&_goods_id=<?php echo $_v['goods_id']?>"><img src="<?php echo $_v['goods_thumbnail_url']?>" width='191' height='180' /></a>
							<div id="wz">
								<p><a href="#"><?php echo $_v['goods_name']?></a></p>
								<span><em>¥</em> <?php echo $_v['goods_price']?></span>
							</div>
						</div>
						<?php }?>
					</div>
				</div>
			</div>
			<div id="detail" >
				<div id="tag"><em>商品详情</em><em>累计评价 <span>12368</span></em></div>
				<div id="param">
					<table>
						<p style="padding:10px;">品牌参数：</p>
						<?php foreach($paraminfo  as $_k => $_v){?>
							<?php if(($_k)%3==0) {echo "<tr>";} ?>
							<td><?php echo $_v['parent_name'].":".$_v['param_name'];?></td>
							<?php }?>
					</table>
				</div>
			<div id="con">
					<div id="dp">
				<img src="<?php echo IMG_URL;?>c10.jpg" />-->
						<?php echo $info[0]['goods_content'];?>
					</div>
					<div id="comment">
					<h2 style="font-size:12px;padding:10px;background:#8e0101;width:780px;margin-top:10px;border:none;"><span style="color:#fff">累计评价 155032</span></h2>
					<div class="line"></div>
					
					<?php if(!empty($eva_content)){ foreach($eva_content as $_v){?>
					<table>
						<tr>
							<td style="width:500px"><?php echo $_v['content'];?></td>
							<td>套餐类型：套餐一</td>
							<td><?php echo $_v['user_name'];?>（匿名）</td>
						</tr>
					</table>	
					<div class="line"></div>
					<?php }}else{?>
					<?php echo "该商品尚未评论";?>
					
					<div class="line"></div>
					<?php }?>
				</div>
				</div>
			</div>
		</div>
		<div id="right">
				<h2 style="text-align:center;font-size:12px;color:#ccc;margin:10px 0;border:none;">---看了又看---</h2>
				<div class="look">
					<a href="#"><img src="<?php echo IMG_URL;?>r1.png" /></a>
					<p><a href="#">宁美国度 四核i5 4590/GTX960...</a></p>
				</div>
				<div class="look">
					<a href="#"><img src="<?php echo IMG_URL;?>r2.png" /></a>
					<p><a href="#">宁美国度AMD870K四核独显台...</a></p>
				</div>
				<div class="look">
					<a href="#"><img src="<?php echo IMG_URL;?>r3.png" /></a>
					<p><a href="#">宁美国度 I5 4590四核台式组...</a></p>
				</div>
				<div class="look">
					<a href="#"><img src="<?php echo IMG_URL;?>r4.png" /></a>
					<p><a href="#">宁美国度 四核i5 4590/GTX960...</a></p>
				</div>
		</div>
	</div>
</body>
</html>